<?php

namespace App\Utils;

class ApiResponse
{
    public static function success($data = [], string $message = 'success', int $code = 200)
    {
        return response()->json([
            'code' => $code,
            'msg' => $message,
            'data' => $data,
        ]);
    }

    public static function error(string $message = 'error', int $code = 1, $httpStatus = 400, $errors = [])
    {
        return response()->json([
            'code' => $code,
            'msg' => $message,
            'errors' => $errors,
        ], $httpStatus);
    }
}
